﻿
                                  <div class="box border primary">
											<div class="box-title">
												<h4><i class="fa fa-bars"></i>Form controls</h4>
												<div class="tools hidden-xs">
													<a href="#box-config" data-toggle="modal" class="config">
														<i class="fa fa-cog"></i>
													</a>
													<a href="javascript:;" class="reload">
														<i class="fa fa-refresh"></i>
													</a>
													<a href="javascript:;" class="collapse">
														<i class="fa fa-chevron-up"></i>
													</a>
													<a href="javascript:;" class="remove">
														<i class="fa fa-times"></i>
													</a>
												</div>
											</div>
											<div class="box-body big">
												<h3 class="form-title">属性添加</h3>
												<form method="post" action="" class="form-horizontal" role="form" enctype="multipart/form-data">
												  <input type="hidden" name="id" value="<?php echo $date['id']?>">
												  <div class="form-group">
													<label class="col-sm-3 control-label">属性类型</label>
													<div style="width:auto;float:left" class="col-sm-1 pid">
													  <select name='attr_type' class="form-control" style="width:150px;float:left">
													         <option <?php echo $date['attr_type']==0?'selected':'' ;?> value="0">单选</option>
													         <option <?php echo $date['attr_type']==1?'selected':'' ;?> value="1">唯一（需要用户手工录入）</option>
													  </select>
													</div>
												  </div>


												  <div class="form-group">
													<label class="col-sm-3 control-label">属性名称</label>
													<div class="col-sm-5">
													  <input name="attr_name" value="<?php echo $date['attr_name']?>" class="form-control" type="text">
													</div>
												  </div>

												  <div class="form-group">
													<label class="col-sm-3 control-label">属性值</label>
													<div class="col-sm-5">
													  <textarea name="attr_value" <?php echo $date['attr_type']==1?'disabled':'';?> class="form-control" placeholder="" rows="4"><?php echo $date['attr_value']?></textarea>
													</div>
												  </div>


                                                <div class="col-sm-offset-3 col-sm-13">
                                                 <button type="submit" class="btn btn-success">提交</button>
													</div>
												 </form>
											</div>
										</div>



<script src="public/admin/js/jquery/jquery-2.0.3.min.js"></script>

<script type="text/javascript">
$(function(){
$('select[name=attr_type]').change(function(){
	if($(this).val()=='1'){
		$('textarea[name=attr_value]').val(' ');
		$('textarea[name=attr_value]').attr('disabled',true);
	}else{
		$('textarea[name=attr_value]').attr('disabled',false);
	}


});
})
</script>